home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 47 / MOBICLIC 47.ISO / mac / DATA / COMMUNS / MOBICLIC_MENUS.CST / 00003_Script_gestion de la navigation < prev    next >
Text File  |  2002-09-19  |  6KB  |  220 lines

  1. -- gestion de la navigation
  2.  
  3. global chemin,pathAide,menuMsg,validMBG,validMHD,volumeOn,touchesOn,pisteAideRub,aideRub
  4. global menusActifs, menuOuvert,  gFlag_special_EKR
  5. -- chemin    : chemin d'accΦs complet au niveau du sommaire
  6. -- pathAide  : nom complet du film appelant l'aide
  7. -- menuMsg   : nom du message retournΘ par les menus de Mobiclic
  8. -- validMBG  : liste de l'activitΘ des items du menu Θquerre bleue
  9. -- validMHD  : liste de l'activitΘ des items du menu Θquerre verte
  10. -- touchesOn : controle l'activation des raccourcis clavier
  11.  
  12. -- navigation entre films
  13. on acces
  14.   set n = the paramCount
  15.   if n > 0 then
  16.     initFilm
  17.     nom = chemin
  18.     if n > 1 then
  19.       -- chemin d'accΦs a ΘtΘ envoyΘ sous forme de plusieurs paramΦtres
  20.       repeat with i=1 to n
  21.         if the machineType = 256 then
  22.           nom = nom & param(i) & "\"
  23.         else
  24.           nom = nom & param(i) & ":"
  25.         end if
  26.       end repeat
  27.       delete char(nom.chars.count) of nom
  28.     else
  29.       -- chemin d'accΦs a ΘtΘ envoyΘ sous forme d'un seul paramΦtre
  30.       if offset(":",param(1)) = 0 and offset("\",param(1)) = 0 then
  31.         -- seulement un nom de fichier a ΘtΘ envoyΘ
  32.         nom = param(1)
  33.       else
  34.         -- un chemin d'accΦs a ΘtΘ envoyΘ
  35.         n = param(1)
  36.         nom = nom & nomDos(n)
  37.       end if
  38.     end if
  39.     put "AccΦs au film : " & nom
  40.     nom = nom & ".dir"
  41.     put nom
  42.     go to movie nom
  43.     niveauSon
  44.   end if
  45. end acces
  46.  
  47. on initFilm
  48.   coupeSon 2,3,4
  49.   menusActifs=1
  50.   menuOuvert = 0
  51. end initFilm
  52.  
  53. -- retour au sommaire
  54. on sommaire
  55.   quitterAtlas 
  56.   coupeSon 2,3,4
  57.   if gFlag_special_EKR <> VOID  then-- permet de gΘrer la commande en interne dans le .dir concernΘ grΓce α la procΘdure locale
  58.     local_sommaire()
  59.   else
  60.     go to movie chemin & "sommaire"
  61.     put "Ouverture du sommaire α " & the time
  62.     niveauSon
  63.   end if
  64. end sommaire
  65. -----------------------------------------
  66. -- accΦs aide gΘnΘrale de Mobiclic
  67. on aideMob
  68.   if gFlag_special_EKR <> VOID  then-- permet de gΘrer la commande en interne dans le .dir concernΘ grΓce α la procΘdure locale
  69.     local_aideMob()
  70.     exit
  71.   end if
  72.   pathAide = the pathName & the movieName
  73.   --  acces("communs","aide")
  74.   go movie "@//COMMUNS/AIDE"
  75. end aideMob
  76. -----------------------------------------
  77. on retourAide
  78.   updateStage
  79.   coupeSon 2,3
  80.   menusActifs=1
  81.   menuOuvert = 0
  82.   case(pathaide) of
  83.     "SOMMAIRE":
  84.       go frame "SOMMAIRE" of movie "SOMMAIRE"
  85.     otherwise:
  86.       go to movie pathAide
  87.   end case
  88. end retourAide
  89.  
  90.  
  91. on aideRub
  92.   if aideRub=0 then
  93.     if the movieName contains "LAN" then
  94.       sprite(pisteAideRub).member = member "aideRub"
  95.     end if
  96.     afficherPistes pisteAideRub
  97.     afficherPistes 1+pisteAideRub
  98.     updateStage
  99.     aideRub=1
  100.     menusActifs=0
  101.     volumeOn=1
  102.     menuOuvert = 1
  103.   else
  104.     if the movieName contains "LAN" then
  105.       sprite(pisteAideRub).member = member "pointPourGlisserSur"
  106.     end if
  107.     masquerPistes 1+pisteAideRub,pisteAideRub
  108.     aideRub=0
  109.     menusActifs=1
  110.     volumeOn=0
  111.     menuOuvert = 0
  112.   end if
  113. end
  114. ---------------------------------
  115. -- quitter mobiclic
  116. on quitte
  117.   quitterAtlas 
  118.   if gFlag_special_EKR <> VOID  then-- permet de gΘrer la commande en interne dans le .dir concernΘ grΓce α la procΘdure locale
  119.     local_quit()
  120.     exit
  121.   end if
  122.   if the optionDown=1 then
  123.     quit
  124.   else
  125.     acces("communs","generic")
  126.   end if
  127. end quitte
  128. ---------------------------------
  129. -- gestion de la navigation par flΦches
  130. on keyDown
  131.   if the moviename contains "_MIAW" then
  132.     pass
  133.     exit
  134.   end if
  135.   if touchesOn=1 then
  136.     set k = the keyCode
  137.     if the machineType = 256 then
  138.       nomCh="raccourcisPC"
  139.     else
  140.       nomCh="raccourcis"
  141.     end if
  142.     repeat with i = 1 to member(nomCh).lines.count
  143.       if k = value(member(nomCh).line[i].word[1]) then
  144.         menuMsg = member(nomCh).line[i].word[2]
  145.         -- annulation raccourci clavier selon activation dans le menu
  146.         case menuMsg of
  147.           "dico": -- appui sur le raccourci clavier dictionnaire
  148.             liste=value(member("selectMenus").line[3])
  149.             if liste[3]=0 then
  150.               menuMsg = empty
  151.               exit repeat
  152.             end if
  153.           "infos": -- appui sur le raccourci clavier dictionnaire
  154.             liste=value(member("selectMenus").line[3])
  155.             if liste[4]=0 then
  156.               menuMsg = empty
  157.               exit repeat
  158.             end if
  159.           "debut": -- appui sur la flΦche haut
  160.             liste=value(member("selectMenus").line[2])
  161.             if liste[3]=0 then
  162.               menuMsg = empty
  163.               exit repeat
  164.             end if
  165.           "retour": -- appui sur flΦche gauche
  166.             liste=value(member("selectMenus").line[2])
  167.             if liste[6]=0 then
  168.               menuMsg = empty
  169.               exit repeat
  170.             end if
  171.           "suite": -- appui sur flΦche droite
  172.             
  173.             liste=value(member("selectMenus").line[2])
  174.             if liste[5]=0 then
  175.               menuMsg = empty
  176.               exit repeat
  177.             end if
  178.           "stop": -- appui sur la barre d'espace (pause)
  179.             liste=value(member("selectMenus").line[2])
  180.             if liste[2]=0 then
  181.               menuMsg = empty
  182.               exit repeat
  183.             end if
  184.           "revoir": -- appui sur la flΦche bas
  185.             liste=value(member("selectMenus").line[2])
  186.             if liste[4]=0 then
  187.               menuMsg = empty
  188.               exit repeat
  189.             end if
  190.           "sommaire": -- appui sur la lettre S
  191.             liste=value(member("selectMenus").line[2])
  192.             if liste[1]=0 then
  193.               menuMsg = empty
  194.               exit repeat
  195.             end if
  196.           "volume": -- appui sur la lettre V
  197.             if field "menuOuvert"<>"0" or volumeOn=1 then
  198.               menuMsg = empty
  199.               exit repeat
  200.             end if
  201.         end case
  202.         if menuMsg <> empty then
  203.           do menuMsg
  204.           menuMsg = empty
  205.         end if
  206.         exit
  207.       end if
  208.     end repeat
  209.   end if
  210. end keyDown
  211.  
  212. -- activation des raccourcis clvier
  213. on touchesOn
  214.   touchesOn=1
  215. end
  216.  
  217. -- dΘsactivation des raccourcis clavier
  218. on touchesOff
  219.   touchesOn=0
  220. end